W6-W8. Functions of Several Variables, Limits and Continuity, Partial Derivatives, Directional Derivatives and Gradients, Extreme Values, Gradient Descent, Lagrange Multipliers, Taylor’s Formula

Author

Mohammad Alkousa

Published

March 18, 2026

1. Summary

1.1 Functions of Several Variables
1.1.1 Domains, Ranges, and Graphs

Most functions you encounter in calculus depend on a single variable. But in science and engineering, quantities almost always depend on several things at once. The temperature inside a room depends on both the coordinates \((x, y, z)\). The profit of a company depends on dozens of variables. We need a theory for such functions.

A function of several variables is a rule that assigns a unique real number to each point in some subset of \(\mathbb{R}^n\). Formally, if \(D\) is a set of \(n\)-tuples \((x_1, x_2, \dots, x_n)\) of real numbers, then a function \(f\) on \(D\) assigns to each element of \(D\) exactly one real number: \[w = f(x_1, x_2, \dots, x_n).\]

The variables \(x_1, \dots, x_n\) are called independent variables, the value \(w\) is the dependent variable, \(D\) is the domain, and the set of all output values is the range.

By convention, if no domain is specified, the natural domain is the largest subset of \(\mathbb{R}^n\) for which the formula gives real numbers.

Finding domains: To find the domain, identify all restrictions:

  • Square roots require the argument to be \(\ge 0\)
  • Logarithms require a strictly positive argument
  • Denominators must be nonzero

Example: For \(f(x, y) = \frac{\sqrt{x + y + 1}}{x - 1}\), we need \(x + y + 1 \ge 0\) and \(x \neq 1\), so \(D_f = \{(x, y) \mid x + y \ge -1,\, x \neq 1\}\).

The graph of \(f(x, y)\) is the set of all points \((x, y, z)\) in \(\mathbb{R}^3\) with \(z = f(x, y)\) and \((x, y) \in D\). This is a surface in 3D space.

1.1.2 Interior Points, Boundary Points, Open and Closed Regions

When working with multivariable functions, we need to be precise about the structure of their domains.

Let \(P_0\) be a point in a region \(R \subseteq \mathbb{R}^n\).

  • \(P_0\) is an interior point of \(R\) if there exists a ball of positive radius centered at \(P_0\) that lies entirely within \(R\). The collection of all interior points is the interior of \(R\). A region is open if it consists entirely of interior points.
  • \(P_0\) is a boundary point of \(R\) if every ball centered at \(P_0\) contains both points inside \(R\) and points outside \(R\). A region is closed if it contains all its boundary points.
  • A region is bounded if it fits inside some ball of finite radius; otherwise it is unbounded.
1.1.3 Level Sets

Visualizing a function of two variables as a 3D surface is often difficult. A more practical tool is the level curve.

The set of all points \((x_1, \dots, x_n)\) where a function takes a fixed value \(c\) is called a level set: \[\mathcal{L}_c(f) = \{(x_1, \dots, x_n) \mid f(x_1, \dots, x_n) = c\}.\]

  • For \(n = 2\): a level set is called a level curve (or contour line).
  • For \(n = 3\): it is called a level surface.
  • For \(n > 3\): it is called a level hypersurface.

Think of contour lines on a topographic map: each line connects points of equal altitude. Similarly, level curves of \(f(x, y)\) connect all points where the function equals \(c\).

Example: For \(f(x, y) = x^2 + y^2\), the level curves \(f = c\) are circles of radius \(\sqrt{c}\) centered at the origin.

1.2 Limits and Continuity for Functions of Several Variables
1.2.1 The Limit Definition

The concept of limit extends naturally to multiple variables, but with an important twist: in \(\mathbb{R}^2\), a point can be approached from infinitely many directions (not just from left or right). This makes limits harder to evaluate — and harder to disprove.

Definition. Let \(f\) be defined on a domain \(D \subseteq \mathbb{R}^n\), and let \(a \in \mathbb{R}^n\) be a point such that \(f\) is defined near \(a\) (but not necessarily at \(a\)). Then: \[\lim_{x \to a} f(x) = L\] means: for every \(\varepsilon > 0\), there exists \(\delta > 0\) such that if \(x \in D\) and \(0 < \|x - a\| < \delta\), then \(|f(x) - L| < \varepsilon\).

Here, \(\|x\| = \sqrt{x_1^2 + \cdots + x_n^2}\) is the Euclidean norm. The key requirement is that the limit value \(L\) must be the same regardless of the direction along which \((x, y)\) approaches \((a, b)\).

1.2.2 Properties of Limits

These properties mirror those from single-variable calculus. If \(\lim_{x \to a} f(x) = L\) and \(\lim_{x \to a} g(x) = M\), then:

  1. \(\lim_{x \to a}(f + g) = L + M\)
  2. \(\lim_{x \to a}(f - g) = L - M\)
  3. \(\lim_{x \to a}(kf) = kL\) for any \(k \in \mathbb{R}\)
  4. \(\lim_{x \to a}(f \cdot g) = L \cdot M\)
  5. \(\lim_{x \to a}\frac{f}{g} = \frac{L}{M}\) (provided \(M \neq 0\))
  6. \(\lim_{x \to a}(f)^m = L^m\) for \(m \in \mathbb{N}\)
  7. \(\lim_{x \to a}\sqrt[m]{f} = \sqrt[m]{L}\) (for \(L > 0\) when \(m\) is even)
  8. Composition: If \(h\) is continuous at \(z = L\), then \(\lim_{x \to a} h(f(x)) = h(L)\)

Example: \(\displaystyle\lim_{(x,y)\to(0,0)} \cos\!\left(\frac{x^2 + y^3}{x + y + 1}\right) = \cos(0) = 1\), using the quotient rule and continuity of cosine.

1.2.3 Two-Path Test for Non-existence of a Limit

The most powerful tool for showing a limit does not exist is the Two-Path Test:

If \(f(x, y)\) has different limits along two different paths approaching \((x_0, y_0)\), then \(\lim_{(x,y)\to(x_0,y_0)} f(x, y)\) does not exist.

The trick is to substitute specific paths (straight lines \(y = kx\), parabolas \(y = kx^2\), etc.) and check whether the resulting limits depend on \(k\). If they do, the limit does not exist.

Example: Show \(\lim_{(x,y)\to(0,0)} \frac{2x^2y}{x^4 + y^2}\) does not exist.

Along the parabola \(y = kx^2\): \[\frac{2x^2 \cdot kx^2}{x^4 + k^2x^4} = \frac{2k}{1 + k^2}.\] This depends on \(k\), so the limit does not exist.

1.2.4 Continuity

A function \(f\) is continuous at the point \(a\) if:

  1. \(f(a)\) is defined,
  2. \(\lim_{x \to a} f(x)\) exists,
  3. \(\lim_{x \to a} f(x) = f(a)\).

A function is continuous if it is continuous at every point of its domain.

Continuity of compositions: If \(f\) is continuous at \(a\) and \(g\) is continuous at \(f(a)\), then the composition \(h = g \circ f\) is continuous at \(a\). This means functions like \(e^{x^2+y^2}\), \(\cos(xy/(z^2+1))\), and \(\ln(1 + x^2y^2)\) are continuous on their natural domains.

1.3 Partial Derivatives
1.3.1 Definition

When a function depends on several variables, we can ask: how does it change if we vary only one variable while holding the others fixed? This is the idea of a partial derivative.

Definition. The partial derivative of \(f(x, y)\) with respect to \(x\) at \((x_0, y_0)\) is: \[\frac{\partial f}{\partial x}\bigg|_{(x_0,y_0)} = f_x(x_0, y_0) = \lim_{h \to 0} \frac{f(x_0 + h, y_0) - f(x_0, y_0)}{h}.\]

Geometrically, \(f_x\) is the slope of the tangent line to the curve obtained by slicing the surface \(z = f(x, y)\) with the vertical plane \(y = y_0\).

Similarly, the partial derivative with respect to \(y\) is: \[f_y(x_0, y_0) = \lim_{h \to 0} \frac{f(x_0, y_0 + h) - f(x_0, y_0)}{h}.\]

How to compute: To find \(\frac{\partial f}{\partial x}\), treat all variables except \(x\) as constants and differentiate with respect to \(x\) using standard rules.

1.3.2 Second and Higher Order Partial Derivatives

Partial derivatives are themselves functions and can be differentiated again. For \(f(x, y)\):

  1. \(f_{xx} = \frac{\partial^2 f}{\partial x^2} = \frac{\partial}{\partial x}\left(\frac{\partial f}{\partial x}\right)\) — differentiate with respect to \(x\) twice
  2. \(f_{yy} = \frac{\partial^2 f}{\partial y^2}\) — differentiate with respect to \(y\) twice
  3. \(f_{xy} = \frac{\partial^2 f}{\partial y \partial x} = \frac{\partial}{\partial y}\left(\frac{\partial f}{\partial x}\right)\) — first \(x\), then \(y\)
  4. \(f_{yx} = \frac{\partial^2 f}{\partial x \partial y}\) — first \(y\), then \(x\)

Clairaut’s (Schwarz’s) Theorem: If \(f\), \(f_x\), \(f_y\), \(f_{xy}\), \(f_{yx}\) are all continuous at \((a, b)\), then \(f_{xy}(a,b) = f_{yx}(a,b)\). In practice, for smooth functions, the order of differentiation doesn’t matter.

1.3.3 Harmonic Functions and Laplace’s Equation

A function \(f(x_1, \dots, x_n)\) is called harmonic if its second-order partial derivatives exist and satisfy the Laplace equation: \[\frac{\partial^2 f}{\partial x_1^2} + \frac{\partial^2 f}{\partial x_2^2} + \cdots + \frac{\partial^2 f}{\partial x_n^2} = 0.\]

Harmonic functions appear in electrostatics, heat conduction, fluid flow, and many other physical contexts.

Example: \(f(x, y) = \ln\sqrt{x^2 + y^2}\) is harmonic: \(f_{xx} = \frac{y^2 - x^2}{(x^2+y^2)^2}\), \(f_{yy} = \frac{x^2 - y^2}{(x^2+y^2)^2}\), so \(f_{xx} + f_{yy} = 0\).

1.3.4 Differentiability and Linearization

A function \(z = f(x, y)\) is differentiable at \((x_0, y_0)\) if the change \(\Delta z = f(x, y) - f(x_0, y_0)\) can be written as: \[\Delta z = f_x(x_0, y_0)\Delta x + f_y(x_0, y_0)\Delta y + \varepsilon_1 \Delta x + \varepsilon_2 \Delta y,\] where \(\Delta x = x - x_0\), \(\Delta y = y - y_0\), and \(\varepsilon_1, \varepsilon_2 \to 0\) as \((x, y) \to (x_0, y_0)\).

Sufficient condition: If \(f_x\) and \(f_y\) exist and are continuous near \((x_0, y_0)\), then \(f\) is differentiable at \((x_0, y_0)\).

Important implications:

  • Differentiability \(\Rightarrow\) Continuity (but not vice versa)
  • Existence of partial derivatives alone does NOT guarantee differentiability

The linearization of \(f\) at \((x_0, y_0)\) is the tangent plane approximation: \[\mathcal{L}(x, y) = f(x_0, y_0) + f_x(x_0, y_0)(x - x_0) + f_y(x_0, y_0)(y - y_0).\] This is the best linear approximation to \(f\) near \((x_0, y_0)\).

1.3.5 Chain Rule

The chain rule extends to functions of several variables.

Case 1: If \(z = f(x, y)\) is differentiable and \(x = x(t)\), \(y = y(t)\) are differentiable, then: \[\frac{dz}{dt} = \frac{\partial f}{\partial x}\frac{dx}{dt} + \frac{\partial f}{\partial y}\frac{dy}{dt}.\]

Case 2: If \(z = f(x, y)\) and \(x = g(s, t)\), \(y = h(s, t)\) are all differentiable, then: \[\frac{\partial z}{\partial s} = \frac{\partial f}{\partial x}\frac{\partial x}{\partial s} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial s}, \qquad \frac{\partial z}{\partial t} = \frac{\partial f}{\partial x}\frac{\partial x}{\partial t} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial t}.\]

General Version: If \(w = f(x_1, \dots, x_n)\) and each \(x_i = x_i(t_1, \dots, t_m)\), then: \[\frac{\partial w}{\partial t_i} = \sum_{j=1}^n \frac{\partial w}{\partial x_j}\frac{\partial x_j}{\partial t_i}.\]

1.3.6 Implicit Differentiation

If a relation \(F(x, y) = 0\) implicitly defines \(y\) as a differentiable function of \(x\), then by the chain rule: \[\frac{dy}{dx} = -\frac{F_x}{F_y} \quad (F_y \neq 0).\]

More generally, if \(F(x, y, z) = 0\) defines \(z = f(x, y)\) implicitly, then: \[\frac{\partial z}{\partial x} = -\frac{F_x}{F_z}, \qquad \frac{\partial z}{\partial y} = -\frac{F_y}{F_z} \quad (F_z \neq 0).\]

1.4 Directional Derivatives and Gradients
1.4.1 The Directional Derivative

Partial derivatives measure the rate of change along coordinate axes. But what if we want to know how fast \(f\) changes in an arbitrary direction?

Definition. The directional derivative of \(f\) at \(P_0(x_0, y_0)\) in the direction of a unit vector \(\mathbf{u} = u_1\hat{\mathbf{i}} + u_2\hat{\mathbf{j}}\) (where \(\|\mathbf{u}\| = 1\)) is: \[D_{\mathbf{u}} f(x_0, y_0) = \lim_{s \to 0} \frac{f(x_0 + u_1 s,\, y_0 + u_2 s) - f(x_0, y_0)}{s}.\]

This is the rate of change of \(f\) per unit distance in the direction \(\mathbf{u}\). If \(\mathbf{u} = \hat{\mathbf{i}}\), we get \(f_x\); if \(\mathbf{u} = \hat{\mathbf{j}}\), we get \(f_y\).

Important: The direction vector \(\mathbf{u}\) must be a unit vector. If you’re given a direction vector \(\mathbf{v}\), first normalize it: \(\mathbf{u} = \mathbf{v}/\|\mathbf{v}\|\).

1.4.2 The Gradient Vector

Definition. The gradient of \(f(x_1, \dots, x_n)\) at a point \(P_0\) is the vector of all partial derivatives: \[\nabla f(P_0) = \begin{pmatrix} \frac{\partial f}{\partial x_1}(P_0) \\ \frac{\partial f}{\partial x_2}(P_0) \\ \vdots \\ \frac{\partial f}{\partial x_n}(P_0) \end{pmatrix}.\]

For \(f(x, y)\): \(\nabla f = f_x \hat{\mathbf{i}} + f_y \hat{\mathbf{j}}\).

Key Theorem: If \(f\) is differentiable at \(P_0\), then: \[D_{\mathbf{u}} f(P_0) = \nabla f(P_0) \cdot \mathbf{u}.\]

The directional derivative equals the dot product of the gradient and the direction vector. This elegant formula replaces the limit definition for computation.

1.4.3 Geometric Interpretation of the Gradient

Since \(D_{\mathbf{u}} f = \|\nabla f\|\cos\theta\) (where \(\theta\) is the angle between \(\nabla f\) and \(\mathbf{u}\)):

  • \(f\) increases most rapidly in the direction of \(\nabla f\) (when \(\theta = 0\)), with rate \(\|\nabla f\|\).
  • \(f\) decreases most rapidly in the direction of \(-\nabla f\) (when \(\theta = \pi\)), with rate \(-\|\nabla f\|\).
  • \(f\) has zero rate of change perpendicular to \(\nabla f\) (when \(\theta = \pi/2\)).

Moreover, the gradient is always normal (perpendicular) to level curves (or level surfaces): at any point \(P_0\), \(\nabla f\) is orthogonal to the level curve of \(f\) through \(P_0\).

1.5 Extreme Values for Functions of Several Variables
1.5.1 Local and Global Extrema

Definition. Let \(f\) be defined on a region \(R \subseteq \mathbb{R}^n\) containing \(x_0\). Then:

  • \(f(x_0)\) is a local maximum if \(f(x_0) \ge f(x)\) for all \(x\) in some open ball around \(x_0\).
  • \(f(x_0)\) is a global (absolute) maximum if \(f(x_0) \ge f(x)\) for all \(x \in R\).
  • Similarly for local minimum and global minimum.
1.5.2 Critical Points and the First Derivative Test

Definition. An interior point \(P_0\) of the domain of \(f\) is a critical point if either \(\nabla f(P_0) = \mathbf{0}\) (all partial derivatives are zero) or at least one partial derivative does not exist at \(P_0\).

First Derivative Test: If \(f\) has a local extremum at an interior point \(P_0\) where partial derivatives exist, then \(\nabla f(P_0) = \mathbf{0}\).

Warning: A critical point need not be a local extremum — it could be a saddle point.

Definition. A critical point \(P_0\) is a saddle point if every open ball around \(P_0\) contains points where \(f > f(P_0)\) and also points where \(f < f(P_0)\) — the function goes up in some directions and down in others, like a mountain pass.

1.5.3 The Second Derivative Test (Hessian)

For \(f(x, y)\), once we find critical points (where \(f_x = f_y = 0\)), the Second Derivative Test classifies them.

Define the discriminant (Hessian): \[D = f_{xx}f_{yy} - (f_{xy})^2 = \begin{vmatrix} f_{xx} & f_{xy} \\ f_{xy} & f_{yy} \end{vmatrix}.\]

Suppose \(f_x(a, b) = f_y(a, b) = 0\) and all second-order partial derivatives are continuous near \((a, b)\). Then:

  1. Local maximum at \((a, b)\): if \(D > 0\) and \(f_{xx}(a, b) < 0\).
  2. Local minimum at \((a, b)\): if \(D > 0\) and \(f_{xx}(a, b) > 0\).
  3. Saddle point at \((a, b)\): if \(D < 0\).
  4. Test inconclusive: if \(D = 0\).
1.5.4 Finding a Function from Its Partial Derivatives

Sometimes we know \(f_x\) and \(f_y\) and need to reconstruct \(f\). The method:

  1. Integrate \(f_x\) with respect to \(x\): \(f = \int f_x \, dx + C(y)\), where \(C(y)\) is an unknown function of \(y\).
  2. Differentiate the result with respect to \(y\): compare with the given \(f_y\) to find \(C(y)\).
  3. Integrate to find \(C(y)\), then write the final answer.

Alternatively, start by integrating \(f_y\) with respect to \(y\).

1.6 Gradient Descent Method

One of the most important applications of gradients is the gradient descent method — the backbone of modern machine learning.

1.6.1 The Optimization Problem

We want to solve: \(\min_{x \in \mathbb{R}^n} f(x)\) where \(f : \mathbb{R}^n \to \mathbb{R}\) is differentiable.

In practice, this problem may be impossible to solve analytically (the function may be high-dimensional, non-convex, or have many local minima). Numerical algorithms are needed.

1.6.2 The Algorithm

The gradient descent (GD) method generates a sequence of points: \[x^{k+1} = x^k - \alpha \nabla f(x^k), \quad k = 0, 1, 2, \dots\] starting from an initial point \(x^0\).

The idea is simple: the gradient \(\nabla f(x^k)\) points in the direction of steepest increase, so moving opposite to it (subtracting \(\alpha \nabla f\)) moves us toward lower values.

Key parameters:

  • \(\alpha > 0\) is the learning rate (or step size): too large → divergence; too small → very slow convergence.
  • Stopping criteria: \(\|\nabla f(x^k)\|_2 \le \varepsilon\) (gradient is small), \(\|x^{k+1} - x^k\|_2 \le \varepsilon\) (steps are small), or maximum iterations reached.

Caution: In non-convex problems, gradient descent may converge to a saddle point rather than a local minimum, depending on the starting point \(x^0\).

Example (2D quadratic): Let \(f(x, y) = x^2 + 4y^2\). Then \(\nabla f = (2x, 8y)\). Starting from \(x^0 = (3, 2)\) with \(\alpha = 0.1\): \[x^1 = (3, 2) - 0.1(6, 16) = (2.4, 0.8), \quad x^2 = (2.4, 0.8) - 0.1(4.8, 6.4) = (1.92, 0.16), \quad \dots\] The sequence converges to the minimum \((0, 0)\).

Example (4D quadratic): Let \(f(\mathbf{x}) = \frac{1}{2}\mathbf{x}^T A \mathbf{x}\) where \(A = \mathrm{diag}(1, 2, 3, 4)\). Then \(\nabla f(\mathbf{x}) = A\mathbf{x}\). The update \(x^{k+1} = x^k - \alpha A x^k = (I - \alpha A)x^k\) converges when \(\alpha < 2/\lambda_{\max}(A) = 1/2\). With \(\alpha = 0.1\) and \(x^0 = (1,1,1,1)^T\), each coordinate decays geometrically to \(0\).

Convergence in non-convex cases: For non-convex \(f\), the algorithm may get trapped at a local minimum or saddle point. Different starting points \(x^0\) can lead to different solutions. There is no guarantee of finding the global minimum.

1.7 Constrained Optimization and Lagrange Multipliers
1.7.1 The Problem of Constrained Extrema

Often we want to optimize a function not freely, but subject to constraints. For example: maximize area given a fixed perimeter, or find the point on a surface closest to the origin.

Method of substitution: Sometimes we can express one variable in terms of others using the constraint and substitute, reducing the problem to an unconstrained one. This works well for simple constraints.

1.7.2 Lagrange Multipliers (One Constraint)

When substitution is inconvenient, the method of Lagrange multipliers provides a systematic approach.

Theorem: Suppose \(f\) and \(g\) are differentiable and \(\nabla g(\mathbf{x}_0) \neq \mathbf{0}\). If \(\mathbf{x}_0\) is a constrained extremum of \(f\) subject to \(g(\mathbf{x}) = 0\), then there exists a scalar \(\lambda_0\) (the Lagrange multiplier) such that: \[\nabla f(\mathbf{x}_0) = \lambda_0 \nabla g(\mathbf{x}_0).\]

Geometric intuition: At a constrained extremum, the level curves of \(f\) and the constraint curve \(g = 0\) are tangent to each other. Being tangent means their normal vectors (the gradients) are parallel, i.e., \(\nabla f = \lambda \nabla g\).

The Lagrangian function: \[\mathcal{L}(\mathbf{x}, \lambda) = f(\mathbf{x}) - \lambda g(\mathbf{x}).\]

Setting \(\nabla_{(\mathbf{x},\lambda)}\mathcal{L} = \mathbf{0}\) yields the system: \[\begin{cases} \nabla f(\mathbf{x}) = \lambda \nabla g(\mathbf{x}), \\ g(\mathbf{x}) = 0. \end{cases}\]

Practical procedure for \(f(x,y,z)\) subject to \(g(x,y,z) = 0\): write 4 equations (\(f_x = \lambda g_x\), \(f_y = \lambda g_y\), \(f_z = \lambda g_z\), \(g = 0\)) in 4 unknowns (\(x, y, z, \lambda\)) and solve.

1.7.3 Multiple Equality Constraints

For \(m\) constraints \(g_1(\mathbf{x}) = 0, \dots, g_m(\mathbf{x}) = 0\) with \(m < n\), use \(m\) Lagrange multipliers \(\lambda_1, \dots, \lambda_m\): \[\mathcal{L}(\mathbf{x}, \lambda_1, \dots, \lambda_m) = f(\mathbf{x}) - \sum_{i=1}^m \lambda_i g_i(\mathbf{x}).\]

The system to solve becomes: \[\begin{cases} \nabla f(\mathbf{x}) = \sum_{i=1}^m \lambda_i \nabla g_i(\mathbf{x}), \\ g_i(\mathbf{x}) = 0, \quad i = 1, \dots, m. \end{cases}\]

1.7.4 Linear Programming Problem

A linear programming (LP) problem is a special case of constrained optimization where both the objective function and the constraints are linear: \[\min_{\mathbf{x}} \mathbf{c}^T \mathbf{x} \quad \text{subject to} \quad A\mathbf{x} \leq \mathbf{b}, \quad \mathbf{x} \geq \mathbf{0}.\]

Here the constraints are inequalities rather than equalities. The feasible set (the region satisfying all constraints) is a convex polytope — a polygon in 2D, a polyhedron in 3D, etc.

Key facts:

  • The optimal value of a linear objective over a convex polytope is always attained at a vertex (corner point) of the feasible region.
  • The simplex method systematically moves from vertex to vertex along edges, improving the objective at each step.
  • Lagrange multipliers generalize to KKT (Karush–Kuhn–Tucker) conditions for inequality-constrained problems: at an optimal point \(\mathbf{x}^*\), there exist multipliers \(\mu_i \geq 0\) (one per inequality constraint) such that \[\nabla f(\mathbf{x}^*) = \sum_i \mu_i \nabla g_i(\mathbf{x}^*), \qquad \mu_i g_i(\mathbf{x}^*) = 0 \text{ (complementary slackness)}.\]
  • For LP, the KKT conditions are both necessary and sufficient for global optimality.

Example: Maximize \(f(x,y) = 3x + 2y\) subject to \(x + y \leq 4\), \(x \leq 3\), \(y \leq 3\), \(x, y \geq 0\). The feasible region is a polygon; evaluating \(f\) at all vertices gives the maximum.

1.8 Taylor’s Formula for Functions of Several Variables
1.8.1 Motivation and Derivation

Just as single-variable functions can be approximated by polynomials (Taylor polynomials), multivariable functions can also be approximated by multivariate polynomials. This is useful for error estimation, optimization, and analysis near critical points.

For \(f(x, y)\), parametrize the segment from \((x_0, y_0)\) to \((x, y)\) as \(x = x_0 + th\), \(y = y_0 + tk\) (where \(h = x - x_0\), \(k = y - y_0\), \(0 \le t \le 1\)). Define \(F(t) = f(x_0 + th, y_0 + tk)\). By the chain rule: \[F'(t) = h f_x + k f_y, \qquad F''(t) = h^2 f_{xx} + 2hk f_{xy} + k^2 f_{yy}.\]

In general, the \(n\)-th derivative is: \[F^{(n)}(t) = \left(h\frac{\partial}{\partial x} + k\frac{\partial}{\partial y}\right)^n f.\]

Applying the single-variable Taylor formula to \(F(t)\) and setting \(t = 1\) gives:

1.8.2 Taylor’s Formula

Taylor’s Formula for \(f(x, y)\) near \((x_0, y_0)\): \[f(x, y) = f(x_0, y_0) + (h f_x + k f_y) + \frac{1}{2!}(h^2 f_{xx} + 2hk f_{xy} + k^2 f_{yy})\] \[+ \frac{1}{3!}(h^3 f_{xxx} + 3h^2 k f_{xxy} + 3h k^2 f_{xyy} + k^3 f_{yyy}) + \cdots + R_n(x, y),\] where \(h = x - x_0\), \(k = y - y_0\), and all partial derivatives are evaluated at \((x_0, y_0)\).

The remainder \(R_n(x, y)\) satisfies: \[|R_n(x,y)| \le \frac{1}{(n+1)!}\left(\max |\text{$(n+1)$-th order derivatives}|\right) \cdot (|h| + |k|)^{n+1}.\]

Special case — quadratic approximation at the origin (when all first derivatives vanish at \((0,0)\) or as the leading terms): \[f(x, y) \approx f(0,0) + f_x(0,0)\,x + f_y(0,0)\,y + \frac{1}{2}\left(f_{xx}(0,0)\,x^2 + 2f_{xy}(0,0)\,xy + f_{yy}(0,0)\,y^2\right).\]


2. Definitions

  • Function of Several Variables: A rule assigning a unique real number \(w = f(x_1, \dots, x_n)\) to each point in a domain \(D \subseteq \mathbb{R}^n\).
  • Domain: The largest set of inputs for which the function produces real values.
  • Interior Point: A point \(P_0 \in R\) such that some open ball centered at \(P_0\) lies entirely within \(R\).
  • Boundary Point: A point \(P_0\) such that every ball around it contains both points in \(R\) and points outside \(R\).
  • Open Region: A region consisting entirely of interior points.
  • Closed Region: A region containing all its boundary points.
  • Level Set: The set \(\{(x_1,\dots,x_n) \mid f(x_1,\dots,x_n) = c\}\) for a constant \(c\).
  • Level Curve: A level set for a function of two variables (\(n = 2\)).
  • Level Surface: A level set for a function of three variables (\(n = 3\)).
  • Limit: \(\lim_{x \to a} f(x) = L\) if \(f(x)\) approaches \(L\) from every direction as \(x \to a\).
  • Two-Path Test: If \(f\) has different limits along two paths to the same point, the limit does not exist.
  • Continuity: \(f\) is continuous at \(a\) if \(f(a)\) is defined and \(\lim_{x \to a} f(x) = f(a)\).
  • Partial Derivative: \(f_x = \lim_{h\to 0}\frac{f(x+h, y) - f(x,y)}{h}\); rate of change of \(f\) with \(x\), holding all other variables fixed.
  • Clairaut’s Theorem: For smooth functions, mixed partial derivatives are equal: \(f_{xy} = f_{yx}\).
  • Harmonic Function: A function satisfying the Laplace equation \(\sum \frac{\partial^2 f}{\partial x_i^2} = 0\).
  • Differentiable Function: \(f\) is differentiable at \((x_0, y_0)\) if the change \(\Delta z\) can be well-approximated by its partial derivatives (satisfying the error condition with \(\varepsilon_1, \varepsilon_2 \to 0\)).
  • Linearization: The best linear approximation \(\mathcal{L}(x,y) = f(x_0,y_0) + f_x(x_0,y_0)(x-x_0) + f_y(x_0,y_0)(y-y_0)\).
  • Gradient: The vector \(\nabla f = (f_{x_1}, \dots, f_{x_n})^T\) of all partial derivatives.
  • Directional Derivative: \(D_\mathbf{u} f(P_0) = \nabla f(P_0) \cdot \mathbf{u}\); rate of change in direction \(\mathbf{u}\) (unit vector).
  • Critical Point: An interior point where \(\nabla f = \mathbf{0}\) or some partial derivative does not exist.
  • Saddle Point: A critical point that is neither a local max nor a local min.
  • Hessian / Discriminant: \(D = f_{xx}f_{yy} - (f_{xy})^2\); used in the Second Derivative Test.
  • Lagrange Multiplier: A scalar \(\lambda\) such that \(\nabla f = \lambda \nabla g\) at a constrained extremum.
  • Lagrangian Function: \(\mathcal{L}(\mathbf{x}, \lambda) = f(\mathbf{x}) - \lambda g(\mathbf{x})\).
  • Gradient Descent: An iterative algorithm \(x^{k+1} = x^k - \alpha \nabla f(x^k)\) for minimizing \(f\).
  • Learning Rate: The step size \(\alpha\) in gradient descent.
  • Taylor’s Formula (Multivariable): A polynomial approximation of \(f(x,y)\) near a point \((x_0,y_0)\) using partial derivatives up to order \(n\), plus a remainder term \(R_n\).

3. Formulas

  • Euclidean Norm: \(\|x\| = \sqrt{x_1^2 + \cdots + x_n^2}\)
  • Partial Derivative (definition): \(f_x(x_0,y_0) = \lim_{h\to 0}\frac{f(x_0+h,y_0)-f(x_0,y_0)}{h}\)
  • Chain Rule (1 parameter): \(\frac{dz}{dt} = \frac{\partial f}{\partial x}\frac{dx}{dt} + \frac{\partial f}{\partial y}\frac{dy}{dt}\)
  • Chain Rule (2 parameters): \(\frac{\partial z}{\partial s} = \frac{\partial f}{\partial x}\frac{\partial x}{\partial s} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial s}\), \(\frac{\partial z}{\partial t} = \frac{\partial f}{\partial x}\frac{\partial x}{\partial t} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial t}\)
  • Implicit Differentiation (\(F(x,y)=0\)): \(\frac{dy}{dx} = -\frac{F_x}{F_y}\)
  • Implicit Differentiation (\(F(x,y,z)=0\)): \(\frac{\partial z}{\partial x} = -\frac{F_x}{F_z}\), \(\frac{\partial z}{\partial y} = -\frac{F_y}{F_z}\)
  • Linearization: \(\mathcal{L}(x,y) = f(x_0,y_0) + f_x(x_0,y_0)(x-x_0) + f_y(x_0,y_0)(y-y_0)\)
  • Gradient: \(\nabla f = \left(\frac{\partial f}{\partial x_1}, \dots, \frac{\partial f}{\partial x_n}\right)^T\)
  • Directional Derivative: \(D_\mathbf{u} f = \nabla f \cdot \mathbf{u}\) (where \(\|\mathbf{u}\| = 1\))
  • Max rate of increase: \(\|\nabla f\|\) in direction \(\nabla f/\|\nabla f\|\)
  • Hessian / Discriminant: \(D = f_{xx}f_{yy} - (f_{xy})^2\)
  • Second Derivative Test: local max if \(D>0, f_{xx}<0\); local min if \(D>0, f_{xx}>0\); saddle if \(D<0\)
  • Lagrange Condition (1 constraint): \(\nabla f = \lambda \nabla g\) and \(g(\mathbf{x}) = 0\)
  • Lagrangian (1 constraint): \(\mathcal{L}(\mathbf{x},\lambda) = f(\mathbf{x}) - \lambda g(\mathbf{x})\)
  • Lagrangian (\(m\) constraints): \(\mathcal{L}(\mathbf{x},\lambda_1,\dots,\lambda_m) = f(\mathbf{x}) - \sum_{i=1}^m \lambda_i g_i(\mathbf{x})\)
  • Gradient Descent: \(x^{k+1} = x^k - \alpha \nabla f(x^k)\)
  • Taylor’s Quadratic (at \((x_0,y_0)\)): \(f \approx f_0 + h f_x + k f_y + \frac{1}{2}(h^2 f_{xx} + 2hk f_{xy} + k^2 f_{yy})\) where \(h = x-x_0\), \(k = y-y_0\)

4. Examples

4.1. Find and Sketch the Domain (Lab 6, Task 1)

Find and sketch the domain for each function:

(a) \(f(x,y) = \sqrt{y - x - 2}\)

(b) \(f(x,y) = \ln(x^2 + y^2 - 4)\)

(c) \(f(x,y,z) = \sqrt{4-x^2}+\sqrt{9-y^2}+\sqrt{1-z^2}\)

Click to see the solution

(a) Need \(y - x - 2 \ge 0\): domain is the closed half-plane \(y \ge x + 2\) (on and above the line \(y = x+2\)).

(b) Need \(x^2+y^2-4 > 0\): domain is the open region outside the circle \(x^2+y^2 = 4\) (radius 2).

(c) Need \(|x| \le 2\), \(|y| \le 3\), \(|z| \le 1\): domain is the box \([-2,2]\times[-3,3]\times[-1,1]\).

Answer: (a) \(y \ge x+2\); (b) \(x^2+y^2 > 4\); (c) \([-2,2]\times[-3,3]\times[-1,1]\)

4.2. Domain Homework (Lab 6, Homework Problem 1)

Find and sketch the domain for each function:

(a) \(f(x,y) = \dfrac{\sin(xy)}{x^2+y^2-25}\)

(b) \(f(x,y,z) = \ln(16-4x^2-4y^2-z^2)\)

Click to see the solution

(a) Need \(x^2+y^2 \neq 25\): domain is \(\mathbb{R}^2\) excluding the circle of radius \(5\).

(b) Need \(4x^2+4y^2+z^2 < 16\): interior of ellipsoid \(\dfrac{x^2}{4}+\dfrac{y^2}{4}+\dfrac{z^2}{16} < 1\).

Answer: (a) \(x^2+y^2 \neq 25\); (b) \(4x^2+4y^2+z^2 < 16\)

4.3. Sketch Level Curves (Lab 6, Task 2)

Sketch the level curves \(z = k\) for:

(a) \(z = x + y - 1\), \(k = -2,-1,0,1,2\)

(b) \(z = y/x\), \(k = -2,-1,0,1,2\)

(c) \(z = x^2 - y^2\), \(k = -2,-1,0,1,2\)

Click to see the solution

(a) \(x+y-1 = k \Rightarrow y = -x+(1+k)\): parallel lines with slope \(-1\), \(y\)-intercepts \(-1,0,1,2,3\).

(b) \(y/x = k \Rightarrow y = kx\): lines through the origin with slopes \(-2,-1,0,1,2\) (undefined at \(x=0\)).

(c) \(x^2-y^2 = k\): hyperbolas; for \(k=0\) the pair of lines \(y = \pm x\).

Answer: (a) Parallel lines; (b) Lines through origin; (c) Hyperbolas

4.4. Level Curves Homework (Lab 6, Homework Problem 2)

Sketch level curves \(z = k\):

(a) \(z = x^2+y^2\), \(k = 0,1,2,3,4\)

(b) \(z = x^2+9y^2\), \(k = 0,1,2,3,4\)

Click to see the solution

(a) \(x^2+y^2 = k\): concentric circles of radius \(\sqrt{k}\) centered at origin (a point for \(k=0\)).

(b) \(x^2+9y^2 = k\): concentric ellipses with semi-axes \(\sqrt{k}\) and \(\sqrt{k}/3\) (a point for \(k=0\)).

Answer: (a) Concentric circles; (b) Concentric ellipses

4.5. Find Limits (Lab 6, Task 3)

(a) \(\displaystyle\lim_{(x,y)\to(\infty,3)} \dfrac{2x-3}{x^3+4y^3}\)

(b) \(\displaystyle\lim_{\substack{(x,y)\to(0,0)\\x\neq y}} \dfrac{x-y+2\sqrt{x}-2\sqrt{y}}{\sqrt{x}-\sqrt{y}}\)

(c) \(\displaystyle\lim_{(x,y)\to(0,0)} \dfrac{1-\cos(xy)}{xy}\)

Click to see the solution

(a) As \(x\to\infty\) with \(y=3\): \(\dfrac{2x-3}{x^3+108} \to 0\) (denominator dominates). Answer: \(0\)

(b) Factor: numerator \(= (\sqrt{x}-\sqrt{y})(\sqrt{x}+\sqrt{y}+2)\). Cancel \((\sqrt{x}-\sqrt{y})\): \[\lim_{(x,y)\to(0,0)}(\sqrt{x}+\sqrt{y}+2) = 2.\] Answer: \(2\)

(c) Let \(u = xy \to 0\): \(\dfrac{1-\cos u}{u} \to 0\) (since \(1-\cos u \approx u^2/2\)). Answer: \(0\)

4.6. More Limit Problems — Homework (Lab 6, Homework Problem 3)

(a) \(\displaystyle\lim_{\substack{(x,y)\to(2,-4)\\y\neq-4}} \dfrac{y+4}{x^2y-xy+4x^2-4x}\)

(b) \(\displaystyle\lim_{\substack{(x,y)\to(2,0)\\2x-y\neq 4}} \dfrac{\sqrt{2x-y-2}}{2x-y-4}\)

(c) \(\displaystyle\lim_{(x,y)\to(0,0)} \dfrac{\sin(x^2+y^2)}{x^2+y^2}\)

(d) \(\displaystyle\lim_{(x,y)\to(0,0)} \dfrac{x^2y}{x^4+y^2}\)

Click to see the solution

(a) Factor denominator: \(x(x-1)(y+4)\). Cancel \((y+4)\): \(\dfrac{1}{x(x-1)} \to \dfrac{1}{2}\) at \((2,-4)\). Answer: \(\dfrac{1}{2}\)

(b) Let \(u = 2x-y-2 \to 2\). Expression \(= \dfrac{\sqrt{u}}{u-2} \to \pm\infty\). Limit does not exist.

(c) Let \(t = x^2+y^2 \to 0\): \(\dfrac{\sin t}{t} \to 1\). Answer: \(1\)

(d) Along \(y=x^2\): \(\frac{1}{2}\). Along \(y=0\): \(0\). No limit. Answer: Does not exist

4.7. Show No Limit Exists (Lab 6, Task 4)

Show that the following have no limit as \((x,y)\to(0,0)\):

(a) \(f(x,y) = -\dfrac{x}{\sqrt{x^2+y^2}}\)

(b) \(f(x,y) = \dfrac{x^4-y^2}{x^4+y^2}\)

Click to see the solution

(a) Along \(x\)-axis (\(y=0\)): \(f \to -\text{sgn}(x)\), giving \(-1\) from right and \(+1\) from left. No limit.

(b) Along \(x\)-axis (\(y=0\)): \(f = 1\). Along \(y=x^2\): \(f = 0\). No limit.

Answer: Different paths give different limits in both cases.

4.8. Show No Limit Exists — Homework (Lab 6, Homework Problem 4)

Show that no limit exists as \((x,y)\to(0,0)\):

(a) \(f(x,y) = \dfrac{xy}{|xy|}\)

(b) \(f(x,y) = \dfrac{x^2-y}{x-y}\) (for \(x \neq y\))

Click to see the solution

(a) Along \(y = x > 0\): \(f = 1\). Along \(y = -x\), \(x > 0\): \(|xy| = x^2\), \(f = \frac{-x^2}{x^2} = -1\). No limit.

(b) Along \(y = 0\): \(f = \frac{x^2}{x} = x \to 0\). Along \(y = x^2\): \(f = \frac{x^2-x^2}{x-x^2} = 0\). Along \(y = 2x\): \(f = \frac{x^2-2x}{x-2x} = \frac{x(x-2)}{-x} = 2-x \to 2\). No limit.

Answer: Both functions have different limits along different paths.

4.9. Define \(f(0,0)\) for Continuity (Lab 6, Task 5)

Define \(f(0,0)\) so that \(f(x,y) = xy\dfrac{x^2-y^2}{x^2+y^2}\) is continuous at the origin.

Click to see the solution

In polar coordinates: \(f = r^2\cos\theta\sin\theta\cos(2\theta) \to 0\) as \(r\to0\).

Answer: \(f(0,0) = 0\)

4.10. Test Continuity — Homework (Lab 6, Homework Problem 5)

Test for continuity at \((0,0)\):

(a) \(f = \begin{cases} \dfrac{x^3-y^3}{x^2+y^2}, & (x,y)\neq(0,0) \\ 0, & (x,y)=(0,0)\end{cases}\)

(b) \(f = \begin{cases} \dfrac{xy(x^2-y^2)}{x^2+y^2}, & (x,y)\neq(0,0) \\ 0, & (x,y)=(0,0)\end{cases}\)

(c) \(f = \begin{cases} \dfrac{x}{\sqrt{x^2+y^2}}, & (x,y)\neq(0,0) \\ 2, & (x,y)=(0,0)\end{cases}\)

Click to see the solution

(a) Polar: \(\dfrac{r^3(\cos^3\theta-\sin^3\theta)}{r^2} = r(\cos^3\theta-\sin^3\theta) \to 0 = f(0,0)\). Continuous.

(b) Polar: \(r^2\cos\theta\sin\theta(\cos^2\theta-\sin^2\theta) \to 0 = f(0,0)\). Continuous.

(c) Along \(y=0\): \(f \to \pm1 \neq 2\). Not continuous.

4.11. Evaluate Limits (Lab 7, Task 1.1)

Evaluate \(\displaystyle\lim_{(x,y)\to(0,0)} \sqrt{x^2+y^2}\ln(x^2+y^2)\).

Click to see the solution

In polar coordinates: \(r \cdot 2\ln r = 2r\ln r\). By L’Hôpital’s rule: \(\lim_{r\to0^+} r\ln r = 0\).

Answer: \(0\)

4.12. Evaluate a Limit via Squeeze (Lab 7, Task 1.2)

Evaluate \(\displaystyle\lim_{(x,y)\to(0,0)} \dfrac{x^2y^2}{\sqrt{x^2+y^2}}\).

Click to see the solution

By AM-GM: \(x^2y^2 \le \dfrac{(x^2+y^2)^2}{4}\). So \(\dfrac{x^2y^2}{\sqrt{x^2+y^2}} \le \dfrac{(x^2+y^2)^{3/2}}{4} = \dfrac{r^3}{4} \to 0\).

Answer: \(0\)

4.13. Existence of Limit — Three Variables (Lab 7, Task 1.3)

Study the existence of the limit at \((0,0,0)\) of \(f(x,y,z) = \dfrac{xyz}{x+y+z}\).

Click to see the solution

The plane \(x+y+z=0\) passes through the origin, so \(f\) is undefined on a surface that cuts through every neighborhood of \((0,0,0)\). The limit does not exist in the standard sense because the function is not defined on an entire punctured ball around the origin.

Answer: The limit does not exist (domain excludes the plane \(x+y+z=0\) through the origin).

4.14. Limit of Three-Variable Function at a Point (Lab 7, Task 1.4)

Study the existence of the limit at \((2,-2,0)\) of \(f(x,y,z) = \dfrac{x+y}{x^2-y^2+z^2}\).

Click to see the solution

Along \(z=0\): \(f = \dfrac{x+y}{(x+y)(x-y)} = \dfrac{1}{x-y} \to \dfrac{1}{4}\).

Along \(x+y=0\) (approaching \((2,-2,0)\) with \(z\to0\)): \(f = 0\).

Different limits \(\Rightarrow\) limit does not exist.

Answer: The limit does not exist.

4.15. Compute Partial Derivatives (Lab 7, Task 2.1)

Compute \(f_x\), \(f_y\), \(f_{xx}\), \(f_{yy}\) for \(f(x,y) = \ln(x^2y + 2xy + 5)\).

Click to see the solution

Let \(u = x^2y+2xy+5\).

\[f_x = \frac{2xy+2y}{u} = \frac{2y(x+1)}{u}, \quad f_y = \frac{x^2+2x}{u} = \frac{x(x+2)}{u}.\]

\[f_{xx} = \frac{2y \cdot u - 2y(x+1)(2xy+2y)}{u^2} = \frac{2y(5-x^2y-2xy-2y)}{u^2}.\]

\[f_{yy} = \frac{-(x^2+2x)^2}{u^2} = \frac{-x^2(x+2)^2}{u^2}.\]

Answer: \(f_x = \dfrac{2y(x+1)}{u}\); \(f_y = \dfrac{x(x+2)}{u}\); \(f_{xx} = \dfrac{2y(5-x^2y-2xy-2y)}{u^2}\); \(f_{yy} = \dfrac{-x^2(x+2)^2}{u^2}\), where \(u = x^2y+2xy+5\).

4.16. Partial Derivatives with Composite Terms (Lab 7, Task 2.2)

For \(f(x,y) = x^3e^{-y} + y^3\sec(\sqrt{x})\) (\(x > 0\)), compute \(f_x\) and \(f_y\).

Click to see the solution

\[f_x = 3x^2e^{-y} + y^3\sec(\sqrt{x})\tan(\sqrt{x})\cdot\frac{1}{2\sqrt{x}}.\] \[f_y = -x^3e^{-y} + 3y^2\sec(\sqrt{x}).\]

Answer: \(f_x = 3x^2e^{-y} + \dfrac{y^3\sec(\sqrt{x})\tan(\sqrt{x})}{2\sqrt{x}}\); \(f_y = -x^3e^{-y} + 3y^2\sec(\sqrt{x})\)

4.17. Partial Derivatives of a Power Function (Lab 7, Task 2.3)

For \(f(x,y) = (y^2\tan x)^{-4/3}\) (\(\tan x \neq 0\), \(y \neq 0\)), compute \(f_x\) and \(f_y\).

Click to see the solution

Let \(u = y^2\tan x\), so \(f = u^{-4/3}\).

\[f_x = -\frac{4}{3}u^{-7/3}\cdot y^2\sec^2 x = -\frac{4y^2\sec^2 x}{3(y^2\tan x)^{7/3}}.\]

\[f_y = -\frac{4}{3}u^{-7/3}\cdot 2y\tan x = -\frac{8y\tan x}{3(y^2\tan x)^{7/3}}.\]

Answer: \(f_x = -\dfrac{4y^2\sec^2 x}{3(y^2\tan x)^{7/3}}\); \(f_y = -\dfrac{8y\tan x}{3(y^2\tan x)^{7/3}}\)

4.18. Check Harmonic Functions (Lab 7, Task 2.4)

Determine whether each function is harmonic:

(a) \(f = x^3+3xy^2\) \(\quad\) (b) \(f = \sin x\cosh y + \cos x\sinh y\) \(\quad\) (c) \(f = \ln\sqrt{x^2+y^2}\)

Click to see the solution

(a) \(f_{xx}+f_{yy} = 6x + 6x = 12x \neq 0\). Not harmonic.

(b) \(f_{xx} = -\sin x\cosh y - \cos x\sinh y\); \(f_{yy} = \sin x\cosh y + \cos x\sinh y\). Sum \(= 0\). Harmonic.

(c) \(f_{xx} = \dfrac{y^2-x^2}{(x^2+y^2)^2}\); \(f_{yy} = \dfrac{x^2-y^2}{(x^2+y^2)^2}\). Sum \(= 0\). Harmonic (for \((x,y)\neq(0,0)\)).

4.19. Chain Rule: \(dz/dt\) (Lab 7, Task 2.5)

If \(z = \sin x\sin y\), \(x = \sqrt{t}\), \(y = 1/t\), compute \(\dfrac{dz}{dt}\).

Click to see the solution

\[\frac{dz}{dt} = \cos x\sin y\cdot\frac{1}{2\sqrt{t}} - \sin x\cos y\cdot\frac{1}{t^2} = \frac{\cos\sqrt{t}\sin(1/t)}{2\sqrt{t}} - \frac{\sin\sqrt{t}\cos(1/t)}{t^2}.\]

Answer: \(\dfrac{\cos\sqrt{t}\sin(1/t)}{2\sqrt{t}} - \dfrac{\sin\sqrt{t}\cos(1/t)}{t^2}\)

4.20. Chain Rule: Three-Variable Composition (Lab 7, Task 2.6)

If \(f(x,y,z) = xe^{2x-y}+yz+e^{xz}\) and \(x(t) = t^2\), \(y(t) = \sin t\), \(z(t) = e^{-t}\), compute \(\dfrac{d}{dt}f(x(t),y(t),z(t))\).

Click to see the solution

\[f_x = e^{2x-y}+2xe^{2x-y}+ze^{xz} = (1+2x)e^{2x-y}+ze^{xz}.\] \[f_y = -xe^{2x-y}+z, \quad f_z = y+xe^{xz}.\] \[x'(t)=2t,\quad y'(t)=\cos t,\quad z'(t)=-e^{-t}.\]

\[\frac{df}{dt} = f_x\cdot 2t + f_y\cdot\cos t + f_z\cdot(-e^{-t}).\]

Substituting \(x=t^2\), \(y=\sin t\), \(z=e^{-t}\):

\[\frac{df}{dt} = \left[(1+2t^2)e^{2t^2-\sin t}+e^{-t}e^{t^2e^{-t}}\right]\cdot 2t + \left[-t^2e^{2t^2-\sin t}+e^{-t}\right]\cos t + \left[\sin t + t^2e^{t^2e^{-t}}\right](-e^{-t}).\]

Answer: \(\dfrac{df}{dt} = 2t\left[(1+2t^2)e^{2t^2-\sin t}+e^{t^2e^{-t}-t}\right] + \left(e^{-t}-t^2e^{2t^2-\sin t}\right)\cos t - e^{-t}\!\left(\sin t + t^2e^{t^2e^{-t}}\right)\)

4.21. Implicit Differentiation: \(dy/dx\) (Lab 7, Task 2.7)

From \(xe^y + \sin(xy) + y - \ln 2 = 0\), compute \(\left.\dfrac{dy}{dx}\right|_{(0,\ln 2)}\).

Click to see the solution

\(F_x = e^y + y\cos(xy)\big|_{(0,\ln2)} = 2+\ln 2\); \(F_y = xe^y+x\cos(xy)+1\big|_{(0,\ln2)} = 1\).

\[\frac{dy}{dx}\bigg|_{(0,\ln2)} = -(2+\ln 2).\]

Answer: \(-(2+\ln 2)\)

4.22. Implicit Differentiation: \(z_x\), \(z_y\) (Lab 7, Task 2.8)

If \(F(x,y,z) = xe^{yz}+y^2z-3 = 0\) defines \(z(x,y)\), compute \(z_x\) and \(z_y\).

Click to see the solution

\(F_x = e^{yz}\), \(F_y = xze^{yz}+2yz\), \(F_z = xye^{yz}+y^2\).

\[z_x = -\frac{e^{yz}}{xye^{yz}+y^2}, \quad z_y = -\frac{xze^{yz}+2yz}{xye^{yz}+y^2}.\]

Answer: \(z_x = -\dfrac{e^{yz}}{xye^{yz}+y^2}\); \(z_y = -\dfrac{xze^{yz}+2yz}{xye^{yz}+y^2}\)

4.23. Directional Derivative (Slope Toward a Point) (Lab 7, Task 2.9)

For \(f(x,y) = \sqrt{x^2+4y^2}\), find the slope at \((1,2)\) in the direction toward \((2,1)\).

Click to see the solution

Direction: \(\mathbf{v} = (1,-1)\), \(\mathbf{u} = \dfrac{1}{\sqrt{2}}(1,-1)\).

\(f_x\big|_{(1,2)} = \dfrac{1}{\sqrt{17}}\), \(f_y\big|_{(1,2)} = \dfrac{8}{\sqrt{17}}\).

\(D_\mathbf{u}f = \dfrac{1}{\sqrt{17}}\cdot\dfrac{1}{\sqrt{2}} + \dfrac{8}{\sqrt{17}}\cdot\dfrac{-1}{\sqrt{2}} = -\dfrac{7}{\sqrt{34}}\).

Answer: \(-\dfrac{7}{\sqrt{34}}\)

4.24. Directional Derivatives — Lab 8 Exercises (Lab 8, Task 1)

Find the slope at point \((1,1,1)\) in the direction of \((1,2,2)\) on \(f = x^2+y^2+z^2\).

Click to see the solution

\(\mathbf{u} = \dfrac{1}{3}(1,2,2)\). \(\nabla f\big|_{(1,1,1)} = (2,2,2)\).

\(D_\mathbf{u}f = (2,2,2)\cdot\dfrac{1}{3}(1,2,2) = \dfrac{2+4+4}{3} = \dfrac{10}{3}\).

Answer: \(\dfrac{10}{3}\)

4.25. Directional Derivative — Lab 8 Homework (Lab 8, Homework Problem 1)

Determine \(D_\mathbf{u}f(3,-1,0)\) for \(f(x,y,z) = 4x-y^2e^{3xz}\) in the direction \(\mathbf{v} = \langle-1,4,2\rangle\).

Click to see the solution

\(\mathbf{u} = \dfrac{1}{\sqrt{21}}(-1,4,2)\).

At \((3,-1,0)\): \(e^{3xz} = 1\). \(f_x = 4\), \(f_y = -2(-1)(1) = 2\), \(f_z = -3(3)(1)(1) = -9\).

\(D_\mathbf{u}f = \dfrac{-4+8-18}{\sqrt{21}} = -\dfrac{14}{\sqrt{21}} = -\dfrac{14\sqrt{21}}{21}\).

Answer: \(-\dfrac{14\sqrt{21}}{21}\)

4.26. Directional Derivative of \(\cos(x/y)\) (Lab 8, Task 2)

For \(f(x,y) = \cos(x/y)\), find \(D_\mathbf{u}f\) in the direction of \(\mathbf{v} = \langle 3,-4\rangle\).

Click to see the solution

\(\mathbf{u} = \dfrac{1}{5}(3,-4)\).

\(f_x = -\dfrac{\sin(x/y)}{y}\); \(f_y = \dfrac{x\sin(x/y)}{y^2}\).

\(D_\mathbf{u}f = \dfrac{-3\sin(x/y)}{5y} + \dfrac{x\sin(x/y)}{y^2}\cdot\dfrac{-4}{5} = -\dfrac{\sin(x/y)}{5}\left(\dfrac{3}{y}+\dfrac{4x}{y^2}\right)\).

Answer: \(D_\mathbf{u}f = -\dfrac{(3y+4x)\sin(x/y)}{5y^2}\)

4.27. Classify Critical Points — Lab 8 Homework (Lab 8, Homework Problem 2)

Find and classify the critical points of:

(a) \(f(x,y) = x^2-y^3-3xy+2x\)

(b) \(f(x,y) = x^4+y^4-4xy+1\)

Click to see the solution

(a) \(f_x = 2x-3y+2 = 0\) and \(f_y = -3y^2-3x = 0 \Rightarrow x = -y^2\).

Substitute: \(-2y^2-3y+2 = 0 \Rightarrow (2y-1)(y+2)=0\), giving \(y=1/2, x=-1/4\) and \(y=-2, x=-4\).

\(f_{xx}=2\), \(f_{yy}=-6y\), \(f_{xy}=-3\), \(D = -12y-9\).

  • \((-1/4, 1/2)\): \(D=-15<0\)saddle.
  • \((-4,-2)\): \(D=15>0\), \(f_{xx}=2>0\)local min.

(b) \(f_x = 4x^3-4y=0 \Rightarrow y=x^3\); \(f_y = 4y^3-4x = 0 \Rightarrow x=y^3\).

Substitute: \(x = x^9 \Rightarrow x=0,\pm1\). Critical: \((0,0)\), \((1,1)\), \((-1,-1)\).

\(D = 144x^2y^2-16\).

  • \((0,0)\): \(D=-16<0\)saddle.
  • \((\pm1,\pm1)\): \(D=128>0\), \(f_{xx}=12>0\)local minima.

Answer:

  1. Saddle at \((-1/4,1/2)\); local min at \((-4,-2)\).

  2. Saddle at \((0,0)\); local minima at \((1,1)\) and \((-1,-1)\).

4.28. Directional Derivative at an Angle (Lab 8, Task 3)

Find the directional derivative of \(f(x,y) = 4x^3-3xy^2\) in the direction \(\theta = \pi/3\), evaluated at \((1,2)\).

Click to see the solution

\(\mathbf{u} = (\cos(\pi/3), \sin(\pi/3)) = (1/2, \sqrt{3}/2)\).

\(f_x = 12x^2-3y^2\); \(f_y = -6xy\). At \((1,2)\): \(f_x = 12-12 = 0\), \(f_y = -12\).

\(D_\mathbf{u}f = 0\cdot\dfrac{1}{2} + (-12)\cdot\dfrac{\sqrt{3}}{2} = -6\sqrt{3}\).

Answer: \(-6\sqrt{3}\)

4.29. Find Functions from Partial Derivatives (Lab 8, Task 4)

Find \(f(x,y)\) for:

(a) \(f_x = 2x+y\), \(f_y = x+4y\)

(b) \(f_x = 3x^2y^2-2x\), \(f_y = 2x^3y+6y\)

(c) \(f_x = xy\cos(xy)+\sin(xy)\), \(f_y = x^2\cos(xy)\)

Click to see the solution

(a) Integrate \(f_x\) w.r.t. \(x\): \(f = x^2+xy+C(y)\). Diff w.r.t. \(y\): \(x+C'(y) = x+4y \Rightarrow C(y)=2y^2\). \(f = x^2+xy+2y^2+C\).

(b) Integrate \(f_x\) w.r.t. \(x\): \(f = x^3y^2-x^2+C(y)\). Diff w.r.t. \(y\): \(2x^3y+C'(y) = 2x^3y+6y \Rightarrow C(y)=3y^2\). \(f = x^3y^2-x^2+3y^2+C\).

(c) Integrate \(f_y = x^2\cos(xy)\) w.r.t. \(y\): \(f = x\sin(xy)+C(x)\). Diff w.r.t. \(x\): \(\sin(xy)+xy\cos(xy)+C'(x) = xy\cos(xy)+\sin(xy) \Rightarrow C'(x) = 0\). \(f = x\sin(xy)+C\).

Answer: (a) \(x^2+xy+2y^2+C\); (b) \(x^3y^2-x^2+3y^2+C\); (c) \(x\sin(xy)+C\)

4.30. Find and Classify Critical Points (Lab 8, Task 5)

Find and classify the critical points of:

(a) \(f(x,y) = x^3-3x+y^3-3y\)

(b) \(f(x,y) = 2x^3+2y^3-9x^2+3y^2-12y\)

(c) \(f(x,y) = 10xye^{-(x^2+y^2)}\)

Click to see the solution

(a) \(f_x = 3(x^2-1)=0 \Rightarrow x=\pm1\); \(f_y = 3(y^2-1)=0 \Rightarrow y=\pm1\). \(D = 36xy\).

  • \((1,1)\): \(D=36>0\), \(f_{xx}=6>0\)local min (\(f=-4\)).
  • \((-1,-1)\): \(D=36>0\), \(f_{xx}=-6<0\)local max (\(f=4\)).
  • \((1,-1)\) and \((-1,1)\): \(D=-36<0\)saddle points.

(b) \(f_x=6x(x-3)=0 \Rightarrow x=0,3\); \(f_y = 6(y+2)(y-1)=0 \Rightarrow y=-2,1\). \(D=(12x-18)(12y+6)\).

  • \((0,-2)\): \(D=324>0\), \(f_{xx}=-18<0\)local max.
  • \((3,1)\): \(D=324>0\), \(f_{xx}=18>0\)local min.
  • \((0,1)\) and \((3,-2)\): \(D=-324<0\)saddle points.

(c) \(f_x = 10ye^{-r^2}(1-2x^2)=0\) and \(f_y = 10xe^{-r^2}(1-2y^2)=0\). Critical: \((0,0)\), \((\pm1/\sqrt{2}, \pm1/\sqrt{2})\).

  • \((0,0)\): saddle (function changes sign nearby).
  • \((1/\sqrt{2},1/\sqrt{2})\) and \((-1/\sqrt{2},-1/\sqrt{2})\): local max (\(f=5/e\)).
  • \((1/\sqrt{2},-1/\sqrt{2})\) and \((-1/\sqrt{2},1/\sqrt{2})\): local min (\(f=-5/e\)).
4.31. Evaluate a Limit by Direct Substitution (Chapter 2, Example 1)

Evaluate \(\displaystyle\lim_{(x,y)\to(0,0)} \cos\!\left(\frac{x^2 + y^3}{x + y + 1}\right)\).

Click to see the solution

Key Concept: When the denominator is nonzero at the limit point and the outer function is continuous, use the Composition Rule.

  1. Evaluate the inner fraction at \((0,0)\): \[\frac{x^2 + y^3}{x + y + 1}\bigg|_{(0,0)} = \frac{0}{1} = 0.\]
  2. Apply continuity of cosine: \(\cos(0) = 1\).

Answer: \(1\)

4.32. Evaluate a Limit Using the Product Rule (Chapter 2, Example 2)

Evaluate \(\displaystyle\lim_{(x,y)\to(0,0)} \frac{e^y \sin x}{x}\).

Click to see the solution
  1. Split using the Product Rule for limits: \[\lim_{(x,y)\to(0,0)} e^y \cdot \lim_{(x,y)\to(0,0)} \frac{\sin x}{x} = 1 \cdot 1 = 1.\]

Answer: \(1\)

4.33. Evaluate a Limit by Direct Substitution (3 Variables) (Chapter 2, Example 3)

Evaluate \(\displaystyle\lim_{(x,y,z)\to(1,0,-1)} \frac{2e^{x+2y-3z}}{x^2 + 2\cos(\sqrt{xy})}\).

Click to see the solution
  1. Substitute \((x,y,z) = (1,0,-1)\) directly (the expression is continuous at this point): \[\frac{2e^{1+0+3}}{1 + 2\cos(0)} = \frac{2e^4}{1 + 2} = \frac{2e^4}{3}.\]

Answer: \(\dfrac{2e^4}{3}\)

4.34. Evaluate a Limit Using Factoring (Chapter 2, Example 4)

Evaluate \(\displaystyle\lim_{\substack{(x,y)\to(1,1)\\ x \neq 1}} \frac{xy - y - 2x + 2}{x - 1}\).

Click to see the solution

Key Concept: Factor the numerator to cancel the indeterminate factor \(x - 1\).

  1. Factor by grouping: \[xy - y - 2x + 2 = y(x-1) - 2(x-1) = (x-1)(y-2).\]
  2. Cancel and evaluate: \[\lim_{\substack{(x,y)\to(1,1)\\ x \neq 1}} (y-2) = 1 - 2 = -1.\]

Answer: \(-1\)

4.35. Evaluate a Limit by Rationalizing (Chapter 2, Example 5)

Evaluate \(\displaystyle\lim_{\substack{(x,y)\to(4,3)\\ x \neq y+1}} \frac{\sqrt{x} - \sqrt{y+1}}{x - y - 1}\).

Click to see the solution

Key Concept: Multiply by the conjugate to eliminate the indeterminate form.

  1. Multiply numerator and denominator by \((\sqrt{x} + \sqrt{y+1})\): \[\frac{x-(y+1)}{(x-y-1)(\sqrt{x}+\sqrt{y+1})} = \frac{1}{\sqrt{x}+\sqrt{y+1}}.\]
  2. Take the limit: \[\frac{1}{\sqrt{4}+\sqrt{4}} = \frac{1}{4}.\]

Answer: \(\dfrac{1}{4}\)

4.36. Show a Limit Does Not Exist (Two-Path Test) (Chapter 2, Example 6)

Does the limit \(\displaystyle\lim_{(x,y)\to(0,0)} \frac{y}{x}\) exist?

Click to see the solution

Key Concept: If two different paths to \((0,0)\) give different limits, the limit does not exist.

  1. Along the \(x\)-axis (\(y = 0\), \(x \neq 0\)): \(f(x, 0) = 0\).
  2. Along \(y = x\): \(f(x,x) = \frac{x}{x} = 1\).

Two different limit values (\(0 \neq 1\)) depending on the path.

Answer: The limit does not exist.

4.37. Show a Limit Does Not Exist (Parabola Paths) (Chapter 2, Example 7)

Show that \(\displaystyle\lim_{(x,y)\to(0,0)} \frac{2x^2y}{x^4 + y^2}\) does not exist.

Click to see the solution
  1. Along \(y = kx^2\) (family of parabolas): \[\frac{2x^2(kx^2)}{x^4 + k^2x^4} = \frac{2k}{1+k^2}.\]
  2. This limit depends on \(k\): for \(k=1\) it equals \(1\); for \(k=0\) it equals \(0\).

Answer: The limit does not exist.

4.38. Compute Partial Derivatives (Chapter 2, Example 8)

For \(f(x, y) = 2x^2 - xy^2 + x^3y + y^2\), find \(f_x\) and \(f_y\).

Click to see the solution
  1. \(f_x\) (treat \(y\) as constant): \[f_x = 4x - y^2 + 3x^2y.\]
  2. \(f_y\) (treat \(x\) as constant): \[f_y = -2xy + x^3 + 2y.\]

Answer: \(f_x = 4x - y^2 + 3x^2y\); \(\quad f_y = -2xy + x^3 + 2y\)

4.39. Partial Derivatives of a Composite Function (Chapter 2, Example 9)

For \(f(x, y) = e^{-x^2}\sin(x + 5y)\), find \(f_x\) and \(f_y\).

Click to see the solution
  1. \(f_x\) (product rule + chain rule): \[f_x = -2x\,e^{-x^2}\sin(x+5y) + e^{-x^2}\cos(x+5y).\]
  2. \(f_y\) (chain rule only, \(x\) is constant): \[f_y = 5e^{-x^2}\cos(x+5y).\]

Answer: \(f_x = e^{-x^2}(-2x\sin(x+5y)+\cos(x+5y))\); \(\quad f_y = 5e^{-x^2}\cos(x+5y)\)

4.40. Implicit Differentiation: One Equation (Chapter 2, Example 10)

Assuming \(y\cos x = x^2 + y^2\) defines \(y\) implicitly as a function of \(x\), find \(\dfrac{dy}{dx}\).

Click to see the solution
  1. Define \(F(x,y) = x^2 + y^2 - y\cos x = 0\).
  2. Compute \(F_x = 2x + y\sin x\) and \(F_y = 2y - \cos x\).
  3. Apply: \(\dfrac{dy}{dx} = -\dfrac{F_x}{F_y} = -\dfrac{2x + y\sin x}{2y - \cos x}\).

Answer: \(\dfrac{dy}{dx} = -\dfrac{2x + y\sin x}{2y - \cos x}\)

4.41. Implicit Differentiation: Three Variables (Chapter 2, Example 11)

Assuming \(F(x, y, z) = e^z - xyz = 0\) defines \(z\) as a differentiable function of \(x\) and \(y\), find \(z_x\) and \(z_y\).

Click to see the solution
  1. \(F_x = -yz\), \(F_y = -xz\), \(F_z = e^z - xy\).
  2. Apply: \(z_x = -\dfrac{F_x}{F_z} = \dfrac{yz}{e^z - xy}\); \(\quad z_y = \dfrac{xz}{e^z - xy}\).

Answer: \(z_x = \dfrac{yz}{e^z-xy}\); \(\quad z_y = \dfrac{xz}{e^z-xy}\)

4.42. Chain Rule with One Parameter (Chapter 2, Example 12)

For \(z = xy^3 - x^2y\) with \(x = t^2+1\) and \(y = t^2-1\), compute \(\dfrac{dz}{dt}\).

Click to see the solution
  1. \(z_x = y^3 - 2xy\), \(z_y = 3xy^2 - x^2\); \(\dot{x} = 2t\), \(\dot{y} = 2t\).
  2. Chain rule: \(\dfrac{dz}{dt} = 2t[(y^3-2xy)+(3xy^2-x^2)]\).
  3. Substitute \(x=t^2+1\), \(y=t^2-1\) and simplify: \[\frac{dz}{dt} = 8t^7 - 18t^5 - 4t^3 + 6t.\]

Answer: \(8t^7 - 18t^5 - 4t^3 + 6t\)

4.43. Chain Rule with Two Parameters (Chapter 2, Example 13)

For \(z = \arctan(x^2+y^2)\) with \(x = s\ln t\) and \(y = te^s\), find \(\dfrac{\partial z}{\partial t}\) and \(\dfrac{\partial z}{\partial s}\).

Click to see the solution
  1. Partial derivatives of \(z\): \[z_x = \frac{2x}{1+(x^2+y^2)^2}, \quad z_y = \frac{2y}{1+(x^2+y^2)^2}.\]
  2. Partial derivatives of \(x\), \(y\): \[x_t = \frac{s}{t},\; x_s = \ln t,\; y_t = e^s,\; y_s = te^s.\]
  3. Apply chain rule: \[\frac{\partial z}{\partial t} = z_x\cdot\frac{s}{t} + z_y\cdot e^s = \frac{2(s^2\ln^2 t + t^2e^{2s})}{t + t(s^2\ln^2 t + t^2e^{2s})^2}.\] \[\frac{\partial z}{\partial s} = z_x\cdot\ln t + z_y\cdot te^s = \frac{2(s\ln^2 t + t^2e^{2s})}{1+(s^2\ln^2 t+t^2e^{2s})^2}.\]

Answer: \(\dfrac{\partial z}{\partial t} = \dfrac{2(s^2\ln^2 t + t^2e^{2s})}{t\left[1 + (s^2\ln^2 t + t^2e^{2s})^2\right]}\); \(\quad \dfrac{\partial z}{\partial s} = \dfrac{2(s\ln^2 t + t^2e^{2s})}{1 + (s^2\ln^2 t + t^2e^{2s})^2}\)

4.44. Directional Derivative via Gradient (Chapter 2, Example 14)

Find the derivative of \(f(x, y) = \arctan(y/x) + \sqrt{3}\arcsin(xy/2)\) at \(P_0(1,1)\) in the direction of \(\mathbf{v} = 3\hat{\mathbf{i}} - 2\hat{\mathbf{j}}\).

Click to see the solution
  1. Normalize: \(\mathbf{u} = \frac{1}{\sqrt{13}}(3, -2)\).
  2. Gradient at \(P_0(1,1)\): \(f_x = 1/2\), \(f_y = 3/2\).
  3. Directional derivative: \[D_\mathbf{u}f = \frac{1}{2}\cdot\frac{3}{\sqrt{13}} + \frac{3}{2}\cdot\frac{-2}{\sqrt{13}} = -\frac{3}{2\sqrt{13}}.\]

Answer: \(-\dfrac{3}{2\sqrt{13}}\)

4.45. Classify Critical Points (Chapter 2, Example 15)

Find and classify the critical points of \(f(x, y) = 2x^3 - 3x^2 - 2y^3 + 3y^2\).

Click to see the solution
  1. \(f_x = 6x(x-1) = 0 \Rightarrow x = 0\) or \(1\); \(f_y = 6y(1-y) = 0 \Rightarrow y = 0\) or \(1\).
  2. Critical points: \((0,0)\), \((0,1)\), \((1,0)\), \((1,1)\).
  3. \(D = (12x-6)(-12y+6)\), \(f_{xy}=0\):
    • \((0,0)\): \(D = -36 < 0\)saddle point.
    • \((0,1)\): \(D = 36 > 0\), \(f_{xx} = -6 < 0\)local maximum.
    • \((1,0)\): \(D = 36 > 0\), \(f_{xx} = 6 > 0\)local minimum.
    • \((1,1)\): \(D = -36 < 0\)saddle point.

Answer: Local max at \((0,1)\), local min at \((1,0)\), saddle points at \((0,0)\) and \((1,1)\).

4.46. Constrained Optimization by Substitution (Chapter 2, Example 16)

Find the point on the plane \(2x + y - z - 5 = 0\) closest to the origin.

Click to see the solution
  1. Minimize \(f = x^2+y^2+z^2\) with \(z = 2x+y-5\): \[h(x,y) = 5x^2 + 2y^2 + 4xy - 20x - 10y + 25.\]
  2. Set \(\nabla h = 0\): \(x = 5/3\), \(y = 5/6\), so \(z = -5/6\).
  3. Verify minimum: \(D = 24 > 0\), \(h_{xx} = 10 > 0\).

Answer: \(P\!\left(\dfrac{5}{3}, \dfrac{5}{6}, -\dfrac{5}{6}\right)\), distance \(= \dfrac{5}{\sqrt{6}}\)

4.47. Lagrange Multipliers — One Constraint (Chapter 2, Example 17)

Find the largest and smallest values that \(f(x, y) = xy\) takes on the ellipse \(\dfrac{x^2}{8} + \dfrac{y^2}{2} = 1\).

Click to see the solution
  1. Set up \(\nabla f = \lambda \nabla g\) with \(g = \frac{x^2}{8}+\frac{y^2}{2}-1\): \[y = \frac{\lambda x}{4}, \quad x = \lambda y.\]
  2. Solve: \(\lambda = \pm 2\), giving critical points \((\pm2, \pm1)\).
  3. Evaluate: \(f(\pm2, \pm1) = 2\) (max); \(f(\mp2, \pm1) = -2\) (min).

Answer: Maximum \(= 2\); Minimum \(= -2\).

4.48. Lagrange Multipliers — Two Constraints (Chapter 2, Example 18)

Find the extreme values of \(f(x,y,z) = 3x+3y+8z\) subject to \(x^2+z^2=1\) and \(y^2+z^2=1\).

Click to see the solution
  1. Set up with multipliers \(\lambda_1\), \(\lambda_2\): \(3 = 2\lambda_1 x\), \(3 = 2\lambda_2 y\), \(8 = 2(\lambda_1+\lambda_2)z\).
  2. Solve: \(\lambda_1 = \lambda_2 = \pm5/2\), giving \(P_1 = (3/5, 3/5, 4/5)\) and \(P_2 = (-3/5,-3/5,-4/5)\).
  3. Evaluate: \(f(P_1) = 10\); \(f(P_2) = -10\).

Answer: Maximum \(= 10\); Minimum \(= -10\).

4.49. Taylor Quadratic Approximation (Chapter 2, Example 19)

Find a quadratic approximation to \(f(x, y) = \sin x \sin y\) near the origin. How accurate is it for \(|x|, |y| \le 0.1\)?

Click to see the solution
  1. Compute derivatives at \((0,0)\): \(f = f_x = f_y = f_{xx} = f_{yy} = 0\); \(f_{xy} = 1\).
  2. Quadratic Taylor: \(f(x,y) \approx xy\).
  3. Error bound: Third-order derivatives \(\le 1\) in absolute value, so \[|R_2| \le \frac{1}{6}(|x|+|y|)^3 \cdot \text{(bound)} \le \frac{8}{6}(0.1)^3 \approx 0.00134.\]

Answer: \(\sin x \sin y \approx xy\); error \(\le 0.00134\).

4.50. Lecture Exercises — Chain Rule (Chapter 2, Task 1)

Find \(\dfrac{dz}{dt}\):

(1) \(z = \sin x \sin y\), \(x = \sqrt{t}\), \(y = 1/t\)

(2) \(z = \ln(x^2+y^2+w^2)\), with \(x = se^t\sin s\), \(y = \arctan t\)

Click to see the solution

(1)

\[\frac{dz}{dt} = \cos x \sin y \cdot \frac{1}{2\sqrt{t}} + \sin x \cos y \cdot \left(-\frac{1}{t^2}\right) = \frac{\cos\sqrt{t}\sin(1/t)}{2\sqrt{t}} - \frac{\sin\sqrt{t}\cos(1/t)}{t^2}.\]

(2) \(z = \ln(x^2+y^2+w^2)\). Note: \(w\) is independent of \(t\) here (the problem only gives \(x\) and \(y\) in terms of \(s\) and \(t\); \(w\) is treated as a separate variable).

With \(x = se^t\sin s\) and \(y = \arctan t\): \[z_x = \frac{2x}{x^2+y^2+w^2},\quad z_y = \frac{2y}{x^2+y^2+w^2}.\] \[x_t = se^t\sin s,\quad y_t = \frac{1}{1+t^2}.\] \[\frac{dz}{dt} = \frac{2x \cdot se^t\sin s + 2y/(1+t^2)}{x^2+y^2+w^2}.\]

Answer (1): \(\dfrac{\cos\sqrt{t}\,\sin(1/t)}{2\sqrt{t}} - \dfrac{\sin\sqrt{t}\,\cos(1/t)}{t^2}\)

4.51. Lecture Exercises — Implicit Differentiation (Chapter 2, Task 2)

Assuming \(xe^y + \sin(xy) + y - \ln 2 = 0\) defines \(y\) as a differentiable function of \(x\), find \(\dfrac{dy}{dx}\) at \((0, \ln 2)\).

Click to see the solution
  1. \(F = xe^y + \sin(xy) + y - \ln 2\).
  2. \(F_x = e^y + y\cos(xy)\). At \((0,\ln 2)\): \(F_x = e^{\ln 2} + \ln 2 = 2 + \ln 2\).
  3. \(F_y = xe^y + x\cos(xy) + 1\). At \((0,\ln 2)\): \(F_y = 1\).
  4. \(\dfrac{dy}{dx} = -\dfrac{F_x}{F_y} = -(2+\ln 2)\).

Answer: \(-(2+\ln 2)\)

4.52. Lecture Exercises — Gradient (Chapter 2, Task 3)

Find the gradient at the given point:

(1) \(f(x,y) = \arctan\!\left(\dfrac{\sqrt{x}}{y}\right)\), at \((4,-2)\)

(2) \(f(x,y,z) = (x^2+y^2+z^2)^{-1/2} + \ln(xyz)\), at \((-1,2,-2)\)

Click to see the solution

(1) Let \(u = \sqrt{x}/y\).

\[f_x = \frac{1}{1+u^2}\cdot\frac{1}{2\sqrt{x}\,y} = \frac{1}{1+x/y^2}\cdot\frac{1}{2\sqrt{x}\,y} = \frac{y}{2\sqrt{x}(y^2+x)}.\]

At \((4,-2)\): \(f_x = \frac{-2}{2\cdot2\cdot8} = \frac{-2}{32} = -\frac{1}{16}\).

\[f_y = \frac{1}{1+u^2}\cdot\frac{-\sqrt{x}}{y^2} = \frac{-\sqrt{x}}{y^2+x}.\]

At \((4,-2)\): \(f_y = \frac{-2}{4+4} = -\frac{1}{4}\).

\(\nabla f(4,-2) = \left(-\dfrac{1}{16}, -\dfrac{1}{4}\right)\).

(2) At \((-1,2,-2)\): \(r = \sqrt{1+4+4} = 3\), so \(r^{-1/2}\)-part: \((x^2+y^2+z^2)^{-3/2} = 1/27\).

\[f_x = \frac{-x}{(x^2+y^2+z^2)^{3/2}} + \frac{1}{x} = \frac{1}{27} + (-1) = -\frac{26}{27}.\]

\[f_y = \frac{-y}{r^3} + \frac{1}{y} = -\frac{2}{27} + \frac{1}{2} = \frac{23}{54}.\]

\[f_z = \frac{-z}{r^3} + \frac{1}{z} = \frac{2}{27} - \frac{1}{2} = -\frac{23}{54}.\]

Answer (1): \(\nabla f = \left(-\dfrac{1}{16},\, -\dfrac{1}{4}\right)\)

Answer (2): \(\nabla f = \left(-\dfrac{26}{27},\, \dfrac{23}{54},\, -\dfrac{23}{54}\right)\)

4.53. Lecture Exercises — Directional Derivative (Chapter 2, Task 4)

Find the derivative at \(P_0\) in the direction of \(\mathbf{u}\):

(1) \(f(x,y) = \dfrac{x-y}{xy+2}\), \(P_0(1,-1)\), \(\mathbf{u} = 12\hat{\mathbf{i}}+5\hat{\mathbf{j}}\)

(2) \(f(x,y,z) = x^2+2y^2-3z^2\), \(P_0(1,1,1)\), \(\mathbf{u} = 2\hat{\mathbf{i}}+\hat{\mathbf{j}}-2\hat{\mathbf{k}}\)

Click to see the solution

(1) Normalize: \(\|\mathbf{u}\| = 13\), \(\hat{\mathbf{u}} = (12/13, 5/13)\).

At \(P_0(1,-1)\): \(xy+2 = 1\), so \(f = 2\).

\[f_x = \frac{1\cdot(xy+2)-(x-y)\cdot y}{(xy+2)^2}\bigg|_{(1,-1)} = \frac{1-(2)(-1)}{1} = 3.\]

\(f_y = \frac{-1\cdot(xy+2)-(x-y)\cdot x}{(xy+2)^2}\). At \((1,-1)\): \(= \frac{-1-(2)(1)}{1} = -3\).

\(D_\mathbf{u}f = 3\cdot\frac{12}{13} + (-3)\cdot\frac{5}{13} = \frac{36-15}{13} = \frac{21}{13}\).

(2) Normalize: \(\|\mathbf{u}\| = 3\), \(\hat{\mathbf{u}} = (2/3, 1/3, -2/3)\).

\(\nabla f = (2x, 4y, -6z)\). At \((1,1,1)\): \(\nabla f = (2,4,-6)\).

\(D_\mathbf{u}f = 2\cdot\frac{2}{3} + 4\cdot\frac{1}{3} + (-6)\cdot\frac{-2}{3} = \frac{4+4+12}{3} = \frac{20}{3}\).

Answer (1): \(\dfrac{21}{13}\)

Answer (2): \(\dfrac{20}{3}\)

4.54. Lecture Exercises — Max/Min Directions (Chapter 2, Task 5)

Find the directions of fastest increase and decrease at \(P_0\), and the corresponding rates:

(1) \(f(x,y) = x^2y + e^{xy}\sin y\), \(P_0(1,0)\)

(2) \(f(x,y,z) = xe^y + z^2\), \(P_0(1, \ln 2, 1/2)\)

Click to see the solution

(1) At \(P_0(1,0)\): \(f_x = (2xy + ye^{xy}\sin y)\big|_{(1,0)} = 0\); \(f_y = (x^2 + e^{xy}(x\sin y + \cos y))\big|_{(1,0)} = 1 + 1 = 2\).

\(\nabla f(1,0) = (0, 2)\), \(\|\nabla f\| = 2\).

Max increase direction: \((0,1)\) (i.e., \(\hat{\mathbf{j}}\)), rate \(= 2\).

Max decrease direction: \((0,-1)\) (i.e., \(-\hat{\mathbf{j}}\)), rate \(= -2\).

(2) \(f_x = e^y\), \(f_y = xe^y\), \(f_z = 2z\). At \(P_0\): \(f_x = 2\), \(f_y = 2\), \(f_z = 1\).

\(\nabla f = (2, 2, 1)\), \(\|\nabla f\| = 3\).

Max increase direction: \((2/3, 2/3, 1/3)\), rate \(= 3\).

Max decrease direction: \((-2/3, -2/3, -1/3)\), rate \(= -3\).

Answer (1): Max increase: \(\hat{\mathbf{j}}\) with rate \(2\); max decrease: \(-\hat{\mathbf{j}}\) with rate \(-2\).

Answer (2): Max increase: \((2/3, 2/3, 1/3)\) with rate \(3\); max decrease: \((-2/3,-2/3,-1/3)\) with rate \(-3\).

4.55. Lecture Exercises — Lagrange Multipliers (Chapter 2, Task 6)

Find the points on the ellipse \(x^2 + 2y^2 = 1\) where \(f(x, y) = xy\) has its extreme values.

Click to see the solution
  1. \(g = x^2+2y^2-1 = 0\); Lagrange condition: \(y = 2\lambda x\), \(x = 4\lambda y\).
  2. Solve: \(\lambda = \pm\frac{1}{2\sqrt{2}}\), giving \(x = \pm\frac{1}{\sqrt{2}}\), \(y = \pm\frac{1}{2}\).
  3. Evaluate: \(f = \pm\frac{1}{2\sqrt{2}}\).

Answer: Max \(= \dfrac{1}{2\sqrt{2}}\); Min \(= -\dfrac{1}{2\sqrt{2}}\).

4.56. Lecture Exercises — Taylor Approximations (Chapter 2, Task 7)

Use Taylor’s formula to find quadratic and cubic approximations of \(f(x,y) = xe^y\) near the origin.

Click to see the solution
  1. Derivatives at \((0,0)\):
    • \(f(0,0) = 0\); \(f_x = e^y \Rightarrow f_x(0,0) = 1\); \(f_y = xe^y \Rightarrow f_y(0,0) = 0\).
    • \(f_{xx} = 0\); \(f_{xy} = e^y \Rightarrow f_{xy}(0,0) = 1\); \(f_{yy} = xe^y \Rightarrow f_{yy}(0,0) = 0\).
    • \(f_{xxx} = 0\); \(f_{xxy} = 0\); \(f_{xyy} = e^y \Rightarrow f_{xyy}(0,0) = 1\); \(f_{yyy} = xe^y \Rightarrow f_{yyy}(0,0) = 0\).
  2. Quadratic approximation (\(n=2\)): \[xe^y \approx x + xy.\]
  3. Cubic approximation (\(n=3\)): \[xe^y \approx x + xy + \frac{1}{2}xy^2.\]

Answer: Quadratic: \(x + xy\); Cubic: \(x + xy + \dfrac{xy^2}{2}\)